<!DOCTYPE html>
<html class="no-js" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Wiki Home</title>
	<meta name="Description" content="WikiHome - Uma plataforma colaborativa de estudantes para estudantes" />
	<meta name="author" content="Alexsandro, Alex, Araújo e Danrley" />
	

	<link href="http://fonts.googleapis.com/css?family=Open+Sans:600"
		type="text/css" rel="stylesheet" />
	<link
		href="#{facesContext.externalContext.requestContextPath}/resources_maps/estilo.css"
		type="text/css" rel="stylesheet" />
	<link
		href="#{facesContext.externalContext.requestContextPath}/resources/css/bootstrap.min.css"
		type="text/css" rel="stylesheet" />

	<script type="text/javascript"
		src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;key=AIzaSyDMEqEISMZxxDHGdYCo124y9jOMtgHH0Fw"></script>
	<script type="text/javascript"
		src="#{facesContext.externalContext.requestContextPath}/resources_maps/mapa.js"></script>
	<script type="text/javascript"
		src="#{facesContext.externalContext.requestContextPath}/resources_maps/jquery-ui.custom.min.js"></script>
	<link rel="shortcut icon"
		href="#{facesContext.externalContext.requestContextPath}/resources/favicon.ico"></link>
	<script type="text/javascript">
		$(window).load(function() {
			if(#{repositorioBean.emptyList(facesContext.messageList)} == false){	
			 $("#messages").click();
			}
			
			document.getElementById("form-login:email").setAttribute("value", "E-mail");
			document.getElementById("form-login:senha").setAttribute("value", "****");
			
	    });
		
	</script>
	<script>
	  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
	
	  ga('create', 'UA-50795482-1', 'de.vu');
	  ga('send', 'pageview');
	
	</script>
	

</h:head>

<h:body>

	<a data-toggle="modal" href="#modalMessages" class="btn btn-info"
		id="messages"></a>

	<p:growl rendered="false" id="growl" showDetail="true" sticky="true" />

	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			
			<h:link outcome="/index">
				<h:graphicImage library="images" name="logo.PNG" class="navbar-brand" style="
					padding-bottom: 0;
					padding-top: 0;
					padding-left: 0;
				"/>
			</h:link>
			
			<button class="navbar-toggle" data-toggle="collapse"
				data-target=".navHeaderCollapse">
				<span class="icon-bar"></span> <span class="icon-bar"></span> <span
					class="icon-bar"></span>
			</button>
			<div class="collapse navbar-collapse navHeaderCollapse">
				<ul class="nav navbar-nav navbar-right">
					<li><h:link value="Home" outcome="/index" /></li>
					<li><h:link value="Marcar Local" outcome="/marcar_local" /></li>
					<li><h:link value="Sobre" outcome="/sobre" /></li>
					<li style="display: #{logado?'':'none'}" class="dropdown"><a
						href="#" class="dropdown-toggle" data-toggle="dropdown">Perfil
							<b class="caret"></b>
					</a>
						<ul class="dropdown-menu" style="min-width: 0px; padding: 0 0;">
							<h:form class="navbar-form navbar-right" role="form"
								style="margin-top:0px; margin-bottom:0px;">
								<li>
									<div class="form-group" style="margin-top: 0px;">
										<a
											href="#{facesContext.externalContext.requestContextPath}/user/index.xhtml"
											class="btn btn-link">Perfil</a>
									</div>

								</li>
								<li>
									<div class="form-group" style="margin-top: 0px;">
										<h:commandLink class="btn btn-link" value="Sair"
											action="#{loginBean.logout}" />
									</div>

								</li>
							</h:form>
						</ul></li>

					<li style="visibility: #{logado?'hidden':'visible'}"
						class="dropdown"><a href="#" class="dropdown-toggle"
						data-toggle="dropdown">Login <b class="caret"></b></a>
						<ul class="dropdown-menu">
							<h:form class="navbar-form navbar-right" role="form"
								id="form-login">
								<li>
									<div class="form-group">
										<h:inputText class="form-control"
											value="#{loginBean.usuario.email}" id="email"
											onblur="if(this.value == ''){this.value='E-mail'}"
											onclick="if(this.value == 'E-mail'){this.value = ''}" />

									</div>
								</li>
								<li>
									<div class="form-group">
										<h:inputSecret class="form-control"
											value="#{loginBean.usuario.senha}" id="senha"
											onblur="if(this.value == ''){this.value='****'}"
											onclick="if(this.value == '****'){this.value = ''}" />
									</div>
								</li>
								<li style="margin-top: 10px; margin-right: 10px;"><h:commandLink
										class="btn btn-success" value="Entrar"
										action="#{loginBean.autentica}" /> <!-- Button trigger modal -->
									<a data-toggle="modal" href="#myModal" class="btn btn-info">Criar
										Conta</a></li>
								<li>
									<div class="form-group">
										<h:link outcome="/mudar_senha.xhtml" class="btn btn-link">Esqueceu
											sua senha?</h:link>
									</div>
								</li>
							</h:form>
						</ul></li>
				</ul>
			</div>
		</div>
	</div>

	<!-- Modal -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">WikiHome</button>
					<h4 class="modal-title">Abra uma conta</h4>
				</div>
				<h:form class="form-horizontal">
					<div class="modal-body">
						<div class="form-group">
							<label for="inputNome" class="col-sm-2 control-label">Nome</label>
							<div class="col-sm-10">
								<p:inputText id="inputNome" value="#{loginBean.usuario.nome}" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputEmail" class="col-sm-2 control-label">Email</label>
							<div class="col-sm-10">
								<p:inputText id="inputEmail" value="#{loginBean.usuario.email}" />
							</div>
						</div>
						<div class="form-group">
							<label for="inputPassword" class="col-sm-2 control-label">Senha</label>
							<div class="col-sm-10">
								<p:password id="inputPassword"
									value="#{loginBean.usuario.senha}" match="inputPassword2"
									validatorMessage="Senhas não correspondem!" />
							</div>
						</div>

						<div class="form-group">
							<label for="inputPassword2" class="col-sm-2 control-label">Confirmar
								Senha</label>
							<div class="col-sm-10">
								<p:password id="inputPassword2"
									value="#{loginBean.usuario.senha}" />
							</div>
						</div>

					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
						<h:commandLink class="btn btn-primary" value="Salvar"
							action="#{loginBean.criaUsuario}"></h:commandLink>
					</div>
				</h:form>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->

	<!-- Modal Mensagens -->
	<div class="modal fade" id="modalMessages" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">Wiki Apê</button>
					<h4 class="modal-title">Aviso!</h4>
				</div>
				<div class="modal-body">
					<p:messages id="messages" showDetail="true" autoUpdate="true"
						closable="true" />
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal-dialog -->
	</div>
	<!-- /.modal -->


	<div id="apresentacao">

		<ui:insert name="main">
		</ui:insert>
	</div>

	<ui:insert name="footer">
	</ui:insert>

	<h:outputScript library="js" name="bootstrap.js" />

</h:body>
</html>